package com.bindatax.event.impl.statistics.dblog.model;

import com.bindatax.core.util.BinDataxStringUtil;

import java.sql.Timestamp;

/**
* 增量日志对象
* @author ChenZhenQin
* @date  16:17 2022/2/23
* @version V1.0.0
*/
public class ZlLog {
    // 主键id
    private String id;
    // 区划名称
    private String xzqhmc;
    // 区划代码
    private String xzqhdm;
    private String sqlGuid;
    // 执行SQL模板的schema
    private String schema;
    // 目标表名称
    private String tableName;
    // 数据增量时间
    private Timestamp zlsj;

    // 本次执行时间
    private Timestamp jlgxsj;

    public static String createId(String xzqhdm,String schema, String sqlId ){
        return BinDataxStringUtil.md5( xzqhdm + schema + sqlId );
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getXzqhmc() {
        return xzqhmc;
    }

    public void setXzqhmc(String xzqhmc) {
        this.xzqhmc = xzqhmc;
    }

    public String getXzqhdm() {
        return xzqhdm;
    }

    public void setXzqhdm(String xzqhdm) {
        this.xzqhdm = xzqhdm;
    }

    public String getSqlGuid() {
        return sqlGuid;
    }

    public void setSqlGuid(String sqlGuid) {
        this.sqlGuid = sqlGuid;
    }

    public String getSchema() {
        return schema;
    }

    public void setSchema(String schema) {
        this.schema = schema;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Timestamp getZlsj() {
        return zlsj;
    }

    public void setZlsj(Timestamp zlsj) {
        this.zlsj = zlsj;
    }

    public Timestamp getJlgxsj() {
        return jlgxsj;
    }

    public void setJlgxsj(Timestamp jlgxsj) {
        this.jlgxsj = jlgxsj;
    }

    @Override
    public String toString() {
        return "ZlLog{" +
                "id='" + id + '\'' +
                ", xzqhmc='" + xzqhmc + '\'' +
                ", xzqhdm='" + xzqhdm + '\'' +
                ", sqlGuid='" + sqlGuid + '\'' +
                ", schema='" + schema + '\'' +
                ", tableName='" + tableName + '\'' +
                ", zlsj=" + zlsj +
                ", jlgxsj=" + jlgxsj +
                '}';
    }
}
